<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            width: 100px;
            height: 100px;
            border: 1px solid red;
        }
        #d1{
            /*设置绝对路径 元素脱离文档流 参照物为窗口*/
            position: absolute;
            top: 0;
            left: 0;
        }
        #big{
            width: 200px;
            height: 200px;
            margin: 100px 0 0 100px;
            background-color: green;
        }
        #big>div{
            width: 100px;
            height: 100px;
            background-color: blue;
            margin: 50px 0 0 50px;
            position: relative;/*改为相对定位目的是做参照物*/
        }
        #big>div>div{
            width: 50px;
            height: 50px;
            background-color: red;
            /*绝对定位 应用场景:当需要往页面中添加一个元素并且不影响其他元素的显示位置，并且可以实现层叠效果*/
            position: absolute;
            left: 0;
            top: 0;
        }
    </style>
</head>
<body>
<div id="big"><div><div></div></div></div>
<div id="d1">div1</div>
<div>div2</div>
<div>div3</div>
</body>
</html>